package com.itheima.pinda.mapstruct;

import com.itheima.pinda.DTO.angency.AgencyScopeDto;
import com.itheima.pinda.DTO.user.CourierScopeDto;
import com.itheima.pinda.entity.agency.PdAgencyScope;
import com.itheima.pinda.entity.user.PdCourierScope;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;

/**
 * @author llhuang10
 * @date 2021/9/30 17:01
 */
@Mapper(builder = @Builder(disableBuilder = true), uses = {MyStringLongMapper.class, MyList2StringMapper.class})
public interface AgencyDTO2Entity {


    /**
     * 结构作业范围表 Entity <---> DTO
     * todo 先忽略一下 作业范围字段 mutiPoints自动转换映射, 由手动自己实现
     * 若找个一个优雅的解决方案, 自定义转换器 从 List <-> String
     */
    // @Mappings({@Mapping(target = "mutiPoints", ignore = true)})
    AgencyScopeDto conver(PdAgencyScope pdAgencyScope);

    // @Mappings({@Mapping(target = "mutiPoints", ignore = true)})
    PdAgencyScope conver(AgencyScopeDto agencyScopeDto);


    /**
     * 快递员作业范围表
     */
    // @Mappings({@Mapping(target = "mutiPoints", ignore = true)})
    CourierScopeDto conver(PdCourierScope pdCourierScope);

    // @Mappings({@Mapping(target = "mutiPoints", ignore = true)})
    PdCourierScope conver(CourierScopeDto courierScopeDto);
}
